package net.zoneland.data.dataprofiling.common.service.impl;

import net.zoneland.data.dataprofiling.common.domain.LogEntity;
import net.zoneland.data.dataprofiling.common.repository.LogRepository;
import net.zoneland.data.dataprofiling.common.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogRepository logRepository;

    @Override
    public void save(LogEntity logDO) {
        logRepository.save(logDO);
    }

    @Override
    public int remove(Long id) {
        logRepository.deleteById(id);
        return 1;
    }

    @Override
    public int batchRemove(Long[] ids) {
        for(Long id:ids){
            remove(id);
        }
        return ids.length;
    }
}
